package com.pptree.service.impl;

import java.util.List;

import com.pptree.dao.NewsDAO;
import com.pptree.dao.impl.NewsDAOImpl;
import com.pptree.service.NewsService;
import com.pptree.vo.News;
import com.pptree.vo.NewsDomain;
import com.pptree.vo.PageVo;

public class NewsServiceImpl implements NewsService {
	
	private NewsDAO newsDao = new NewsDAOImpl();
	
	
	@Override
	public List<News> findNewsTopNum(int tid, int num) {
		return newsDao.findNewsTopNum(tid,num);
	}


	@Override
	public int addNews(News news) {
		return newsDao.addNews(news);
	}


	@Override
	public int delNews(int nid) {
		
		return newsDao.delNews(nid);
	}


	@Override
	public int updateNews(News news) {
		
		return newsDao.updateNews(news);
	}


	@Override
	public List<NewsDomain> findAllNews() {
		return newsDao.findAllNews();
	}


	@Override
	public News findById(int nid) {
		
		return newsDao.findById(nid);
	}


	@Override
	public List<News> findNewsTopN(int top) {
		return newsDao.findNewsTopN(top);
	}


	@Override
	public PageVo<NewsDomain> findByPaging(int curPageNo, int pageSize) {
		
		return newsDao.findByPaging(curPageNo, pageSize);
	}



}
